package ch11;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Properties;

class _24_PropertiesEx3 {
	public static void main(String[] args) {
		Properties prop = new Properties();		

		prop.setProperty("timeout", "30");
		prop.setProperty("language", "kr");
		prop.setProperty("size", "10");
		prop.setProperty("capacity", "10");

		try {
			prop.store(new FileOutputStream("c:/DEV/workspace/output.txt"), "Properties Example");
			prop.storeToXML(new FileOutputStream("c:/DEV/workspace/output.xml"), "Properties Example");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
/*
[output.txt]
#Properties Example
#Sun Aug 03 20:44:38 KST 2014
capacity=10
size=10
timeout=30
language=kr

[output.xml]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Properties Example</comment>
<entry key="capacity">10</entry>
<entry key="size">10</entry>
<entry key="timeout">30</entry>
<entry key="language">kr</entry>
</properties>
*/
